<template>
  <div style="padding-bottom: 50px;">
    <search-wrapper></search-wrapper>
    <business-card :initInfo="initInfo" :paging="paging"> </business-card>
  </div>
</template>

<script>
export default {
  name: "index",
  components: {
    searchWrapper: () => import("@/components/searchWrapper/index"),
    businessCard: () => import("@/components/businessCardPage/index")
  },
  data() {
    return {
      initInfo: [],
      paging: false
    };
  },
  methods: {
    getInfo() {
      this.$ajax
        .get(this.$api.getTotalList)
        .then(res => {
          for (let item of res.data.list) {
            item.username = item.name;
            item.money = item.total_money;
          }
          this.initInfo = res.data.list;
        })
        .catch(err => {
          this.$notification.error({
            message: err
          });
        });
    }
  },
  created() {
    this.getInfo();
  }
};
</script>

<style scoped lang="less"></style>
